<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
    <!--[if lte IE 6]>
    <meta http-equiv="refresh" content="5;URL=tuwebaqui.html" />
    <![endif]-->
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" href="css/estilos.css">
    <title>Uni2 | {$usuario.usu_nombre} {$usuario.usu_apellido}</title>
    <link rel="shortcut icon" href="images/icono.png">
    <!--[if lte IE 6]><link rel="stylesheet" href="http://b.static.ak.fbcdn.net/rsrc.php/zB1WO/hash/c5zu0405.css" type="text/css" /><![endif]-->
    {literal}
    <style type="text/css">
    body{
        color:#333333;
		direction:ltr;
        font-family:Arial, Helvetica, sans-serif;
        font-size:11px;
		text-align:left;
    }
    </style>
    {/literal}
    {literal}
    <script language="javascript">
		function cambia(num) {
			document.getElementById('item1').className = 'menu-item';
			document.getElementById('item2').className = 'menu-item';
			document.getElementById('item3').className = 'menu-item';
			document.getElementById('item4').className = 'menu-item';
			document.getElementById('item5').className = 'menu-item';
			document.getElementById('item6').className = 'menu-item';
			switch(num) {
				case 1: document.getElementById('item1').className = 'menu-item-active';
						break;
				case 2: document.getElementById('item2').className = 'menu-item-active';
						break;
				case 3: document.getElementById('item3').className = 'menu-item-active';
						break;
				case 4: document.getElementById('item4').className = 'menu-item-active';
						break;
				case 5: document.getElementById('item5').className = 'menu-item-active';
						break;
				case 6: document.getElementById('item6').className = 'menu-item-active';
						break;
				default: break;
			}
			
		}
    </script>
    
    <script language="javascript">
		function closeMessage() {
			document.getElementById('mensaje').innerHTML="";
			document.getElementById('mensaje').className="";
			document.getElementById('bloquea-header').className="";
		}
		function cargarFoto() {
			document.getElementById('mensaje').innerHTML='<form name="frmFoto" enctype="multipart/form-data" action="ingresarFoto.php" method="post"><div class="mensaje-titulo">Cambiar imagen de perfil</div><div class="mensaje-texto">Seleccionar imagen: <input type="file" name="txtFoto" /></div><div class="div-mensaje-boton"><input type="submit" class="mensaje-boton" value="Aceptar" /></div></form>';
  			document.getElementById('mensaje').className='mensaje';
			document.getElementById('bloquea-header').className="bloquea-header";
		}
		function eliminarFoto() {
			document.getElementById('mensaje').innerHTML='<form name="frmFoto" action="eliminarFoto.php" method="post"><div class="mensaje-titulo">Quitar imagen de perfil</div><div class="mensaje-texto">Esta seguro de quitar la imagen de perfil?</div><div class="div-mensaje-boton"><input type="button" class="mensaje-boton" onclick="closeMessage()" value="Cancelar" /><input type="submit" class="mensaje-boton" value="Aceptar" /></div></form>';
  			document.getElementById('mensaje').className='mensaje';
			document.getElementById('bloquea-header').className="bloquea-header";
		}
	</script>
    
    <!--Inicio Calendario-->
    <script language="javascript">
    // Event Calendar
	// copyright Stephen Chapman, 10th June 2006, 30th October 2006
	
	var tb = 'b'; // top or bottom (t or b)
	var headbg = '#cccccc';  // table heading background colour
	var todaybg = '#99cccc'; // current selected date background colour
	var textclr = '#000000'; // text colour
	var linkclr = '#CC0000'; // link text colour
	var noMessage =  'No hay eventos para hoy'; // message to display when no entry in array
	
	var dA = new Array(); var x = 0;
	// first 8 characters in ccyymmdd format for single date events
	// first 8 characters in 0000mmdd format for every year events
	{/literal}
		{foreach item=c from=$calendario}
			{literal}
				dA[x++] = "{/literal}{$c.ano_fecha_inicio|date_format:"%Y"}{$c.ano_fecha_inicio|date_format:"%m"}{$c.ano_fecha_inicio|date_format:"%d"} {$c.ano_descripcion}{literal}";
			{/literal}
		{/foreach}
	{literal}
	
	var pageLoaded = 0;
	window.onload = function() {
		pageLoaded = 1;
	}
	
	function loaded(i,f) {
		if (document.getElementById && document.getElementById(i) != null) f();else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100);
	}
	
	function monthlength(month,year) {
		var dd = new Date(year, month, 0);
		return dd.getDate();
	}
	
	var moy = ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Augosto','Septiembre','Octubre','Noviembre','Diciembre'];
	var today = new Date();
	var selDate = today.getFullYear()+getmmdd(today.getMonth()+1,today.getDate());
	
	function dispCal(yy,mm) {
		if (mm < 0 || mm > 12) {
			alert('month must be between 1 and 12');
			return false;
		}
		if (yy != 0 && (yy < 1901 || yy > 2100)) {
			alert('year must be after 1900 and before 2101');
			return false;
		}
		
		var dow = ['Do','Lu','Ma','Mi','Ju','Vi','Sa'];
		var calendar = new Date(); 
		var today = calendar.getDate();
		calendar.setDate(1);
		if (yy > 1900) calendar.setFullYear(yy);
		if (mm > 0) calendar.setMonth(mm - 1);
		var yy = year = calendar.getFullYear();
		var month = calendar.getMonth();
		calendar.setDate(today);
		var weekday = calendar.getDay();
		var daysInMonth = monthlength(month+1,year);
		var hilite_start = '<td width="30" style="background:' + todaybg + '" align="center"><b>';
		var td_start = '<td width="30" align="center">';
		var cal = '<div id="cal"><div style="border:1pt solid #cccccc;height:115px;width:150px"><table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td colspan="7" style="background:' + headbg + '" align="center"><b>' + moy[month]  + ' ' + year + '<\/b><\/td><\/tr><tr>';
		for(dex=0; dex < 7; dex++) {
			cal += td_start + dow[dex] + '</td>';
		}
		cal += '<\/tr><tr>';
		var day2 = today;
		for (dex = today; dex > 6; dex -=7)
			day2 = dex;
		weekday -= day2 - 1;
		while (weekday < 0)
			weekday += 7;
		for(dex=0; dex < weekday; dex++)
			cal += td_start + ' <\/td>';
		for(dex=1; dex <= daysInMonth; dex++) {
			if(weekday == 7) {
				cal += '</tr><tr>'; weekday = 0;
			}
			if(selDate==year+getmmdd(month+1,dex))
				cal += hilite_start +'<span '+clickDate(dex,month,year) + '>'+ dex + '<\/span><\/b><\/td>';
			else
				cal += td_start + '<span '+clickDate(dex,month,year) + '>' + dex + '<\/span><\/td>';
			weekday += 1;
		}
		for(dex=weekday; dex < 7; dex++)
			cal += td_start + ' <\/td>';
		cal += '<\/tr><\/table><\/div>';
		if (document.getElementById) {
			var mmb = month;  
			mm = month + 1; 
			var yya = yyb = yy; 
			if (mmb <1) {
				mmb += 12; yyb--;
			} 
			var mma = month + 2; 
			if (mma > 12) {
				mma -= 12; yya++;
			} 
			var yb = yy -1; 
			var ya = yy +1; 
			//Flechas fondo
			cal += '<table border="0" cellspacing="0" cellpadding="2" width="150"><tr><td><a href="#" onclick="if (cala = dispCal('+yb+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><<</a></td><td><a href="#" onclick="if (cala = dispCal('+yyb+','+mmb+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><</a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+yya+','+mma+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">></a></td><td align="right"><a href="#" onclick="if (cala = dispCal('+ya+','+mm+')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">>></a></td></tr></table>';
		} else {
			cal += '<div> </div>';
		}
		cal += '</div>';
		return cal;
	}
	
	function start() {
		var x = '<div id="calDate" style="border:1pt solid #cccccc;width:150px"><\/div>';
		var y = '';
		if (tb == 't')
			y = x + dispCal(0,0);
		else
			y = dispCal(0,0) + x;
		document.getElementById('calendar').innerHTML = y;
		ev();
	}
	loaded('calendar',start);
	
	function clickDate(day, month, year) {
		var ct = nextDate(year + getmmdd(month+1,day));
		if (ct == '')
			ct = nextDate('0000' + getmmdd(month+1,day));
		if (ct == '')
			return 'style="color:'+textclr+'"';
		else
			return 'style="cursor:pointer; color:'+linkclr+'" onclick="selDate = '+year+ getmmdd(month+1,day)+'; isDate(' + day + ',' + month + ',' + year + '); return false;"';
	}
	
	function isDate(dayVal,monthVal,yearVal) {
		var ct = nextDate(yearVal + getmmdd(monthVal+1,dayVal));
		if (ct == '')
			ct = nextDate('0000' + getmmdd(monthVal+1,dayVal));
		if (ct == '')
			ct = noMessage;
		document.getElementById('calDate').innerHTML = '<center><b>'+ct+'</b></center>';
		return false;
	}
	
	function nextDate(yymmdd) {
		var x = dA.length;
		for (var i = 0; i < x; i++) {
			if (dA[i].substr(0,8) == yymmdd)
				return dA[i].substr(8);
		}return '';
	}
	
	function getmmdd(mm,dd) {
		return (mm > 9 ? '' + mm : '0' + mm) + (dd > 9 ? dd : '0' + dd);
	}
	
	function ev() {
		var ct = nextDate(selDate);
		var ct = nextDate(selDate);
		if (ct == '')
			ct = nextDate('0000' + selDate.substr(4));
		if (ct == '')
			ct = noMessage;
		document.getElementById('calDate').innerHTML = '<center><b>'+ct+'</b></center>' ;
	}
    </script>
    <!--Inicio Calendario-->
    
    
    <script language="javascript">
		function CrearCalendario(){
			if (window.XMLHttpRequest){
				getCalendario=new XMLHttpRequest()
			}else if (window.ActiveXObject){
				getCalendario=new ActiveXObject("Microsoft.XMLHTTP")
			}
			if (getCalendario){
				var url="calendario.xml";
				getCalendario.onreadystatechange=CambioDeEstado;
				getCalendario.open("GET",url,true);
				getCalendario.send(null);
			}else{
				alert ("Tu explorador no soporta XMLHttpRequest");
			}
		}
		
		function CambioDeEstado(){
			if (getCalendario.readyState == 4){
				xmlCalendario = getCalendario.responseXML;
				xmlCalendario = xmlCalendario.getElementsByTagName('cita');
				setCal(0); //Empezar a dibujar el Calendario
			} 
		} 
    </script>
    {/literal}
<head>

<body>
		<div class="header-back">
            <div class="header-front">
            	<div id="bloquea-header"></div>
                 <div class="logo"><img src="images/profiles/logo.png" width="90%"/></div>
                 <div class="profile-name">{$usuario.usu_nombre} {$usuario.usu_apellido}</div>
                 <div class="menu-top">
                    <div class="menu-top-item"><a href="logout.php">Cerrar Sesi&oacute;n</a></div>
                    <div class="menu-top-item"><a href="">Mi Informaci&oacute;n</a></div>
                    <div class="menu-top-item"><a href="">Mis Amigos</a></div>
                    <div class="menu-top-item"><a href="http://{$url}" target="_blank" >Mi Universidad</a></div>
                 </div>
                 

                 <div class="menu-opc" id="menu-opc">
                    <div id="item1" class="menu-item-active"><a href="home.php" onclick="cambia(1)">Inicio</a></div>
                    <div id="item2" class="menu-item"><a href="contactos.php" target="iframe" onclick="cambia(2)">Contactos</a></div>
                    <div id="item3" class="menu-item"><a href="calendario.php" target="iframe" onclick="cambia(3)">Calendario</a></div>
                    <div id="item4" class="menu-item"><a href="notas.php" target="iframe" onclick="cambia(4)">Notas</a></div>
                    <div id="item5" class="menu-item"><a href="eventos.php" target="iframe" onclick="cambia(5)">Eventos</a></div>
                    <div id="item6" class="menu-item"><a href="album.php" target="iframe" onclick="cambia(6)">Album de Fotos</a></div>
                 </div>
                 
            </div>
        </div>
    
    <div class="contenido">
    	<div id="mensaje"></div>
        <div class="profile-info">
        	<div class="profile-image">
                <img src="images/profiles/{$usuario.usu_foto}" width="100%" />
            </div>
            <div class="profile-links">
            	<a onclick="cargarFoto()" class="link">{if $usuario.usu_foto != "noPicture.jpg"}Cambiar{else}Cargar{/if} Foto de Perfil</a><br />
                {if $usuario.usu_foto != "noPicture.jpg"}<a onclick="eliminarFoto()" class="link">Quitar Foto de Perfil</a>{/if}
            </div>
            <div class="profile-basic-info">
                <div class="titulo">Informaci&oacute;n</div>
                <div class="basic-info">
                	{if $usuario.usu_situacionSentimental}
                    <span class="subtitulo">Estado sentimental:</span><br />
                    <span class="info">{$usuario.usu_situacionSentimental}</span><br /><br />
                    {/if}
                    <span class="subtitulo">Fecha de nacimiento:</span><br />
                    <span class="info">{$usuario.usu_fechaNacimiento}</span><br /><br />
                </div>
            </div>
            <div class="profile-basic-info">
                <div class="titulo">Estudios</div>
                <div class="basic-info">
                    <span class="subtitulo">Universidad:</span><br />
                    <span class="info">{$universidad}</span><br /><br />
                    <span class="subtitulo">Facultad:</span><br />
                    <span class="info">{$facultad}</span><br /><br />
                </div>
            </div>
            <div class="profile-basic-info">
                <div class="titulo">Calendario</div>
                <div id="calendar"></div>  
            </div>
        </div>
        
        <div class="iframe">
        	<iframe name="iframe" width="750px" height="700px" src="inicio.php" frameborder="0"></iframe>
        </div>
        
    </div>
    
    <div class="footer">
    	Uni2 &copy; 2009
    </div>    
</body>
</html>